#include "login.h"
#include "ui_login.h"

#include <QMessageBox>
#include<QDebug>
login::login(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::login)
{
    ui->setupUi(this);
}

login::~login()
{
    delete ui;
}

void login::on_loginbt_clicked()
{
    QString user =ui->user_edit->text();
    QString pass=ui->passwd_edit->text();

    if(user=="root"&&pass=="123"){
        //跳转主界面
        win=new MainWindow;
        win->setName(user);
        win->show();
        this->close();
    }else{
        QMessageBox::warning(this,"提示","登陆失败",QMessageBox::Ok);
        return;
    }
}
